package com.desaysv.wandroid.ui.main.mvp;

import android.util.Log;

import com.desaysv.mvp.BasePresenter;
import com.desaysv.svhttp.callback.IRequestCallBack;
import com.desaysv.wandroid.entity.AirticEntity;
import com.desaysv.wandroid.entity.BaseRes;

import java.util.List;
import java.util.Map;

/**
 * @author linzi
 * @date 2022-11-9
 */
public class MainPresenter extends BasePresenter<MainContract.MainView, MainModel> {
    private static final String TAG = "MainPresenter";

    public MainPresenter() {
        Log.e(TAG, "MainPresenter: 初始化");
    }

    public void test() {
        getModel().refreshData(0, new IRequestCallBack<BaseRes<AirticEntity>>() {

            @Override
            public void response(int status, Map<String, List<String>> headers, BaseRes<AirticEntity> res) {
                Log.e(TAG, "response: " + res.getData().getCurPage());
            }

            @Override
            public void start() {

            }

            @Override
            public void error(Throwable error) {

            }

            @Override
            public void complete() {

            }
        });
    }

    @Override
    protected void onDestory() {
        super.onDestory();
        Log.e(TAG, "onDestory: 销毁");
    }
}
